Skip to main content

SQL vs NoSQL

The two main types of databases.

SQL

SQL - Structured Query Language

  • SQL groups data into tables, which is good for things like names or addresses
  • It is very good at relationships between data tables
    • ex. Can link customers table to orders table by customer id, and link products table to orders table by product id
  • Not very flexible - doesn't like having gaps
    • Inserts a null if something isn't there, like if someone ops not to submit and email address

NoSQL

NoSQL - Not Only SQL

  • Can function like JSON objects. Things don't have to have all the same fields or same structure
  • Non-relational - won't be as fast as SQL database for searching relational data
  • More flexible, newer
  • Better for scaling
note

There are many database options out there. These are just a few.

MySQL vs MongoDB

MySQLMongoDB
SQLNoSQL
More MatureShiny and New
Table StructureDocument Structure
Requires a SchemaMore Flexible to Changes
Great with RelationshipsNot Great with Complex Relationships
Scales VerticallyScales Horizontally

Create, Read, Update, Destroy

Otherwise known as CRUD - these are the most important things you'll do with any database.